package br.ufmg.dees.insane.ui.rich.prep.view.command;

import br.ufmg.dees.insane.model.geo.halfEdgeDataStructure.Edge;
import br.ufmg.dees.insane.model.geo.halfEdgeDataStructure.HalfEdge;
import br.ufmg.dees.insane.model.geo.halfEdgeDataStructure.Vertex;
import br.ufmg.dees.insane.model.prep.HalfEdgePrepModel;
import br.ufmg.dees.insane.util.IPoint3d;

/**
 * This class represents the Euler operator MEV (Make Edge, Vertex).
 * @author Ferreira, Reginaldo
 * @since 14/02/2007
 */
public class OpEulerMEV {
	
	@SuppressWarnings("unused")
	private HalfEdgePrepModel modelHE;
	@SuppressWarnings("unused")
	private Vertex vStart, vEnd;
	private Edge edge;

//  ****************************************************************************
//  Constructor(s)
//  ****************************************************************************

	/** This operator adds a new edge and a new vertex in the model.
	 * @param mdlHE: the half-edge data structure of the model.
	 */
	public OpEulerMEV(HalfEdgePrepModel mdlHE)
	{
		this.modelHE = mdlHE;
	}
	
//  ****************************************************************************
	
	/** Make an new edge using two vertex that already exist. */
	public Edge makeEdge(Vertex v1, Vertex v2)
	{
		this.edge = new Edge(v1, v2);		
		return this.edge;
	}
	
	
//  ****************************************************************************
	
	/** Make an new edge using one vertex that already exist and a new point. */
	public Edge makeEdge(Vertex vStart, IPoint3d p3d)
	{
		this.vEnd = new Vertex("",p3d);
		this.edge = new Edge(vStart, vEnd);
		
		return this.edge;
	}
	
//  ****************************************************************************
	
	/** Make a new edge and two new vertex using 3d points. */
	public Edge makeEdge(IPoint3d p3dStart, IPoint3d p3dEnd)
	{
		this.vStart = new Vertex("",p3dStart);
		this.vEnd   = new Vertex("",p3dEnd);
		
		this.edge = new Edge(vStart, vEnd);
		
		return this.edge;
	}	
	
//  ****************************************************************************
	
	/** Make an new edge using two half-edges that already exist. */
	public Edge makeEdge(HalfEdge heR, HalfEdge heL)
	{
		this.edge = new Edge(heR, heL);
		return this.edge;
	}

	
//  ****************************************************************************
} // end of the class
